<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

        .active {
            background-color: red;
        }
    </style>
</head>
<body>

    <button class="active">1</button>
    <button>2</button>
    <button>3</button>
    <button>4</button>
    <button>5</button>


    <script src="./jquery.js"></script>
    <script>

        $('button').on('click', function () {
            $(this)
                .addClass('active')     // 给自己加class
                .siblings()             // 选中兄弟们
                .removeClass('active'); // 把兄弟们的class移除
        });

        console.log( $('button').eq(2) );


    </script>
</body>
</html>
